<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>浅拷贝</title>
		<script type="text/javascript">
			var obj = {
				name:'张三',
				height:185,
				info:{
					age:18
				}
			}
			
			//浅拷贝-----只拷贝一层，更深层次的对象级别只拷贝引用(地址)
			var o = {};
			for(var k in obj) {
				o[k] = obj[k];
			}
			console.log(o);
			
			//浅拷贝 --- 新拷贝之后的对象修改了深层次的对象之后，原来的对象也会改变
			o.info.age = 20;
			console.log(obj)
		</script>
	</head>
	<body>
	</body>
</html>
